<!DOCTYPE html>
<html>
<head>
	<title>在线工具</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body style="margin:0 auto;width:800px">
     <div style="margin-top:10px">
	 <!--转换后的格式-->
	 转换后的隔开符号： <select id="flag"><option value=",">逗号【默认】</option><option value=".">点</option></select><br/><hr>
     待转换的数据<textarea rows="15" cols="100" id="origin-data"></textarea><br/>
     已转换的数据<textarea rows="15" cols="100" id="new-data"></textarea><br/><br/>
     <button style="width:200px;height:50px;font-size:20px;margin-left:300px;cursor:pointer" onclick="changeData()">转换</button>
     </div>

     <script>
         function changeData(){
		     var flagObj = document.getElementById("flag");
			 //获取隔开符号
			 var index = flagObj.selectedIndex;
			 var flag = flagObj.options[index].value;
			 
         	 var origin_data = document.getElementById("origin-data").value;
         	 var new_data = origin_data.replace(/\r/ig, "").replace(/\n/ig, flag); 
         	 document.getElementById("new-data").value = new_data;
         	 copyToClipBoard(new_data);
         	 if ( window.clipboardData ) {
         	 	 window.clipboardData.setData("Text", new_data);  
             	 alert('转换成功，已自动复制转换的内容!');  
         	 }
         }
     </script>
</body>
</html>